From: Alexander Larsson Date: Fri, 26 Sep 2025 13:37:50 +0000 (+0200) Subject: rust: Regenerate and release 0.20.5 X-Git-Tag: archive/raspbian/2025.7-2+rpi1^2^2~6^2^2~10^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=3d4a8a5daa6e8a6ee507cf514873f96e00928599;p=ostree.git rust: Regenerate and release 0.20.5 This adds the new bindings for signing and composefs use. --- diff --git a/rust-bindings/src/auto/blob_reader.rs b/rust-bindings/src/auto/blob_reader.rs new file mode 100644 index 00000000..1957b8aa --- /dev/null +++ b/rust-bindings/src/auto/blob_reader.rs @@ -0,0 +1,38 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files +// DO NOT EDIT + +use crate::{ffi}; +use glib::{prelude::*}; +#[cfg(feature = "v2016_5")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] +use glib::{translate::*}; + +glib::wrapper! { + #[doc(alias = "OstreeBlobReader")] + pub struct BlobReader(Interface); + + match fn { + type_ => || ffi::ostree_blob_reader_get_type(), + } +} + +impl BlobReader { + pub const NONE: Option<&'static BlobReader> = None; + +} + +pub trait BlobReaderExt: IsA + 'static { + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] + #[doc(alias = "ostree_blob_reader_read_blob")] + fn read_blob(&self, cancellable: Option<&impl IsA>) -> Result, glib::Error> { + unsafe { + let mut error = std::ptr::null_mut(); + let ret = ffi::ostree_blob_reader_read_blob(self.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } +} + +impl> BlobReaderExt for O {} diff --git a/rust-bindings/src/auto/functions.rs b/rust-bindings/src/auto/functions.rs index a5cded8a..df5744b8 100644 --- a/rust-bindings/src/auto/functions.rs +++ b/rust-bindings/src/auto/functions.rs @@ -92,12 +92,17 @@ pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 { } } -//#[cfg(feature = "v2021_1")] -//#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] -//#[doc(alias = "ostree_commit_metadata_for_bootable")] -//pub fn commit_metadata_for_bootable(root: &impl IsA, dict: /*Ignored*/&glib::VariantDict, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { -// unsafe { TODO: call ffi:ostree_commit_metadata_for_bootable() } -//} +#[cfg(feature = "v2021_1")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] +#[doc(alias = "ostree_commit_metadata_for_bootable")] +pub fn commit_metadata_for_bootable(root: &impl IsA, dict: &glib::VariantDict, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { + unsafe { + let mut error = std::ptr::null_mut(); + let is_ok = ffi::ostree_commit_metadata_for_bootable(root.as_ref().to_glib_none().0, dict.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } +} #[doc(alias = "ostree_content_file_parse")] pub fn content_file_parse(compressed: bool, content_path: &impl IsA, trusted: bool, cancellable: Option<&impl IsA>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> { diff --git a/rust-bindings/src/auto/mod.rs b/rust-bindings/src/auto/mod.rs index d5ab73b2..5b4a1592 100644 --- a/rust-bindings/src/auto/mod.rs +++ b/rust-bindings/src/auto/mod.rs @@ -5,6 +5,9 @@ mod async_progress; pub use self::async_progress::AsyncProgress; +mod blob_reader; +pub use self::blob_reader::BlobReader; + mod bootconfig_parser; pub use self::bootconfig_parser::BootconfigParser; @@ -186,6 +189,7 @@ pub use self::constants::SUMMARY_SIG_GVARIANT_STRING; pub use self::constants::TREE_GVARIANT_STRING; pub(crate) mod traits { + pub use super::blob_reader::BlobReaderExt; pub use super::repo_finder::RepoFinderExt; pub use super::sign::SignExt; } diff --git a/rust-bindings/src/auto/repo.rs b/rust-bindings/src/auto/repo.rs index 78b90b6b..bb9d4da3 100644 --- a/rust-bindings/src/auto/repo.rs +++ b/rust-bindings/src/auto/repo.rs @@ -133,10 +133,15 @@ impl Repo { } } - //#[doc(alias = "ostree_repo_commit_add_composefs_metadata")] - //pub fn commit_add_composefs_metadata(&self, format_version: u32, dict: /*Ignored*/&glib::VariantDict, repo_root: &RepoFile, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { - // unsafe { TODO: call ffi:ostree_repo_commit_add_composefs_metadata() } - //} + #[doc(alias = "ostree_repo_commit_add_composefs_metadata")] + pub fn commit_add_composefs_metadata(&self, format_version: u32, dict: &glib::VariantDict, repo_root: &RepoFile, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { + unsafe { + let mut error = std::ptr::null_mut(); + let is_ok = ffi::ostree_repo_commit_add_composefs_metadata(self.to_glib_none().0, format_version, dict.to_glib_none().0, repo_root.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } #[doc(alias = "ostree_repo_commit_transaction")] pub fn commit_transaction(&self, cancellable: Option<&impl IsA>) -> Result { diff --git a/rust-bindings/src/auto/sign.rs b/rust-bindings/src/auto/sign.rs index bda6c8c4..2da863ea 100644 --- a/rust-bindings/src/auto/sign.rs +++ b/rust-bindings/src/auto/sign.rs @@ -6,6 +6,9 @@ use crate::{ffi}; #[cfg(feature = "v2020_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] use crate::{Repo}; +#[cfg(feature = "v2025_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] +use crate::{BlobReader}; use glib::{prelude::*}; #[cfg(feature = "v2020_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] @@ -163,19 +166,23 @@ pub trait SignExt: IsA + 'static { } } - //#[cfg(feature = "v2025_2")] - //#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] - //#[doc(alias = "ostree_sign_read_pk")] - //fn read_pk(&self, stream: &impl IsA) -> /*Ignored*/BlobReader { - // unsafe { TODO: call ffi:ostree_sign_read_pk() } - //} + #[cfg(feature = "v2025_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] + #[doc(alias = "ostree_sign_read_pk")] + fn read_pk(&self, stream: &impl IsA) -> BlobReader { + unsafe { + from_glib_full(ffi::ostree_sign_read_pk(self.as_ref().to_glib_none().0, stream.as_ref().to_glib_none().0)) + } + } - //#[cfg(feature = "v2025_2")] - //#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] - //#[doc(alias = "ostree_sign_read_sk")] - //fn read_sk(&self, stream: &impl IsA) -> /*Ignored*/BlobReader { - // unsafe { TODO: call ffi:ostree_sign_read_sk() } - //} + #[cfg(feature = "v2025_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))] + #[doc(alias = "ostree_sign_read_sk")] + fn read_sk(&self, stream: &impl IsA) -> BlobReader { + unsafe { + from_glib_full(ffi::ostree_sign_read_sk(self.as_ref().to_glib_none().0, stream.as_ref().to_glib_none().0)) + } + } #[cfg(feature = "v2020_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] diff --git a/rust-bindings/src/auto/versions.txt b/rust-bindings/src/auto/versions.txt index 6bc2563d..cc83a324 100644 --- a/rust-bindings/src/auto/versions.txt +++ b/rust-bindings/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 19ccbbc9a3d1) -from gir-files (@ ac81709f18d2) +from gir-files (@ 9ff946fcca99) diff --git a/rust-bindings/sys/src/auto/versions.txt b/rust-bindings/sys/src/auto/versions.txt index 6bc2563d..cc83a324 100644 --- a/rust-bindings/sys/src/auto/versions.txt +++ b/rust-bindings/sys/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 19ccbbc9a3d1) -from gir-files (@ ac81709f18d2) +from gir-files (@ 9ff946fcca99) diff --git a/rust-bindings/sys/src/lib.rs b/rust-bindings/sys/src/lib.rs index c430fb7d..253e73d1 100644 --- a/rust-bindings/sys/src/lib.rs +++ b/rust-bindings/sys/src/lib.rs @@ -3473,6 +3473,8 @@ extern "C" { // OstreeBlobReader //========================================================================= pub fn ostree_blob_reader_get_type() -> GType; + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] pub fn ostree_blob_reader_read_blob( self_: *mut OstreeBlobReader, cancellable: *mut gio::GCancellable,